org.eclipse.vtp.desktop.projects.core.internals
Class MediaFilesFolder

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
      extended by org.eclipse.vtp.desktop.projects.core.internals.MediaFilesFolder
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IMediaContainer, IMediaFilesFolder, ObjectListener, IVoiceToolsResource

public class MediaFilesFolder
extends VoiceResource
implements IMediaFilesFolder

This is a concrete implementation of IMediaFilesFolder and provides the default behavior of that interface.

Version:
2.0
Author:
Trip Gilman

Constructor Summary
MediaFilesFolder(IVoiceToolsResource parent, org.eclipse.core.resources.IFolder folder)
          Creates a new MediaFilesFolder in the parent container with the given eclipse folder resource.
 
Method Summary
 IMediaFile create(java.lang.String name)
          Creates a new media file with the given name.
 IMediaFile create(java.lang.String name, java.io.InputStream source, org.eclipse.core.runtime.IProgressMonitor monitor)
          Creates a new media file with the given name.
 org.eclipse.core.resources.IFile getAlternateTextFile()
           
 IMediaFile getMediaFile(java.lang.String name)
          Locates the media file with the given name.
 IMediaFolder getMediaFolder(java.lang.String name)
          Locates the media folder with the given name.
 java.lang.String getName()
           
 java.lang.String getObjectId()
          The object id is used by the event system to uniquely identify a project resource.
 IVoiceToolsResource getParent()
          Returns the parent of this resource.
 java.util.List listMediaResources()
           
 IMediaFolder makeDirectory(java.lang.String name)
          Creates a new media folder with the given name.
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
addRefreshListener, deferEvents, finalize, getAdapter, getProject, processObjectEvent, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IVoiceToolsResource
addRefreshListener, deferEvents, getProject, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

MediaFilesFolder

public MediaFilesFolder(IVoiceToolsResource parent,
                        org.eclipse.core.resources.IFolder folder)
Creates a new MediaFilesFolder in the parent container with the given eclipse folder resource.

Parameters:
parent - The parent container of this resource
folder - The eclipse folder resource this media file folder represents
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface IVoiceToolsResource
Returns:
The name of the resource

listMediaResources

public java.util.List listMediaResources()
                                  throws org.eclipse.core.runtime.CoreException
Specified by:
listMediaResources in interface IMediaContainer
Returns:
The list of IMediaResources contained by this media folder resource
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while enumerating the media resources

getMediaFolder

public IMediaFolder getMediaFolder(java.lang.String name)
Description copied from interface: IMediaContainer
Locates the media folder with the given name.

Specified by:
getMediaFolder in interface IMediaContainer
Parameters:
name - The name of the desired media folder
Returns:
The desired media folder or null if not found

getMediaFile

public IMediaFile getMediaFile(java.lang.String name)
Description copied from interface: IMediaContainer
Locates the media file with the given name.

Specified by:
getMediaFile in interface IMediaContainer
Parameters:
name - The name of the desired media file
Returns:
The desired media file or null if not found

getParent

public IVoiceToolsResource getParent()
Description copied from interface: IVoiceToolsResource
Returns the parent of this resource. If this is a project resource this function returns this.

Specified by:
getParent in interface IVoiceToolsResource
Returns:
The parent of this resource resource

create

public IMediaFile create(java.lang.String name)
                  throws org.eclipse.core.runtime.CoreException
Description copied from interface: IMediaContainer
Creates a new media file with the given name. The created file will be initially empty (0 length).

Specified by:
create in interface IMediaContainer
Parameters:
name - The name of the new media file
Returns:
The newly created media file
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while creating the new media file

create

public IMediaFile create(java.lang.String name,
                         java.io.InputStream source,
                         org.eclipse.core.runtime.IProgressMonitor monitor)
                  throws org.eclipse.core.runtime.CoreException
Description copied from interface: IMediaContainer
Creates a new media file with the given name. It's initial contents will be retrieved from the provided input stream. The progress monitor will be used to provide user feedback during the operation.

Specified by:
create in interface IMediaContainer
Parameters:
name - The name of the new media file
source - The initial contents of the file
monitor - A progress monitor for user feedback
Returns:
The newly created media file
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while creating the new media file

makeDirectory

public IMediaFolder makeDirectory(java.lang.String name)
                           throws org.eclipse.core.runtime.CoreException
Description copied from interface: IMediaContainer
Creates a new media folder with the given name.

Specified by:
makeDirectory in interface IMediaContainer
Parameters:
name - The name of the new media folder
Returns:
The newly created media folder
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while creating the media folder

getObjectId

public java.lang.String getObjectId()
Description copied from class: VoiceResource
The object id is used by the event system to uniquely identify a project resource. In this fashion, multiple references to the resource can be created and still be notified of events.

Specified by:
getObjectId in class VoiceResource
Returns:
A unique identifier for this resource

getAlternateTextFile

public org.eclipse.core.resources.IFile getAlternateTextFile()
Returns:
An eclipse file reference to the file that contains the alternate mapping information.